package appbuilder.wizards.gui;

import javax.swing.JPanel;

public abstract class WizardPage extends JPanel {
	private Wizard wizard;
	
	public WizardPage() {
		super();
	}
	
	public WizardPage(Wizard wizard) {
		super();
		this.wizard = wizard;
	}
	
	public abstract boolean canGoNext();
	
	public boolean onBeforeNext() {
		return true;
	}
	
	public void onBeforeShow() {
	}
	
	public boolean onBeforeFinish() {
		return true;
	}
	
	public void addProperty(String key, Object value) {
		this.getWizard().addProperty(key, value);
	}
	
	public Object getProperty(String key) {
		return this.getWizard().getProperty(key);
	}
	
	public void removeProperty(String key) {
		this.getWizard().removeProperty(key);
	}
	
	public void setWizard(Wizard wizard) {
		this.wizard = wizard;
	}
	
	public Wizard getWizard() {
		return wizard;
	}
}
